package de.kardass.jannobatch.skiprepeatabort;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import de.kardass.jannobatch.ItemReaderAdapter;

public class ItemReader extends ItemReaderAdapter<WorkflowItem> {
    
    private List<WorkflowItem> items = new ArrayList<WorkflowItem>();

    @Override
    public void onStartUp() {
        super.onStartUp();
        items.add(new WorkflowItem(0, 0, "complete workflow test"));
        items.add(new WorkflowItem(1, 0, "repeat 1st step test"));
        items.add(new WorkflowItem(2, 0, "skip 1st step test"));
        items.add(new WorkflowItem(3, 0, "skip item test"));
        items.add(new WorkflowItem(4, 0, "abort job"));
    }

    @Override
    public Iterator<WorkflowItem> iterator() {
        return items.iterator();
    }

}
